package cn.owng.server.plaza.socket;

import cn.owng.protobuf.plaza.Message;
import org.springframework.web.socket.WebSocketSession;

import java.io.IOException;

/**
 * 微信公众号请关注: 开源螺丝钉
 * <br>
 * 码云请关注: <a href="https://gitee.com/xiyoufang">https://gitee.com/xiyoufang</a>
 * <br>
 * 哔哩哔哩请关注: <a href="https://space.bilibili.com/438927834">https://space.bilibili.com/438927834</a>
 *
 * @author xiyoufang
 */
public interface RequestHandler {

    /**
     * 处理消息
     *
     * @param session session
     * @param request request
     */
    void handle(WebSocketSession session, Message.Request request) throws IOException;

    /**
     * 是否支持处理
     *
     * @param session session
     * @param request request
     * @return bool
     */
    boolean isSupport(WebSocketSession session, Message.Request request);

}
